﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace School.WebPages.School
{
    public partial class Introduction : System.Web.UI.Page
    {
        TechnologySchoolEntities db = new TechnologySchoolEntities();

        protected void Page_Load(object sender, EventArgs e)
        {
            byte category = byte.Parse(Request.QueryString["categories"]);

            lblCategory.Text = db.SubMenu.FirstOrDefault(s => s.Categories == category).Name;
            var schoolIntrol = db.Article.FirstOrDefault(a => a.SubMenu.Categories == category && a.IsEnabled == true);
            if (schoolIntrol != null)
            {
                ltlContent.Text = schoolIntrol.Content;
            }
        }
    }
}
